package hu.vaes_dot_hrak.szoftlab4;

import hu.vaes_dot_hrak.szoftlab4.Constant.Way;

public class FoodStore extends FieldElement {
	private int foodQuantity;

	public FoodStore(Field position, int foodQuantity) {
		super(position);
		this.foodQuantity = foodQuantity;
	}

	public boolean antTryStoleFood() {
		if (this.foodQuantity > 0) {
			System.out.println("Ant stole food");
			foodQuantity--;
			return true;
		} else {
			return false;
		}
	}

	public int getFoodQuantity() {
		return this.foodQuantity;
	}

	@Override
	public boolean isOnStepable() {
		return true;
	}

	@Override
	public void onStep(Ant ant) {
		boolean isFoodOnThisField = antTryStoleFood();
		if (isFoodOnThisField) {
			ant.setHasFood(true);
		}
	}

	@Override
	public void onAntKillerToxic() {

	}

	@Override
	public boolean spinyAntEaterTryToEat() {
		return false;
	}

	@Override
	public int stonePushableToThis() {
		return 1;
	}

	@Override
	public boolean isPushable() {
		return false;
	}

	@Override
	public void push(Way way) {
		// TODO Auto-generated method stub

	}

	@Override
	public void pushedStone(Constant.Way way) {
	}
}
